package com.victualler.core.config.menu.entity;

import com.victualler.core.base.dao.BaseDao;
import com.victualler.core.common.annotation.InitEditColumn;
import com.victualler.core.common.enums.ColumnFormatEnum;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @Aouthor Guoshichang
 * @Date 16:10 on 2018/7/5.
 * @Function 菜单类型
 */
@Entity
@Table(name="common_menu_bar")
public class MenuDao extends BaseDao implements Serializable {
    //图标
    @InitEditColumn(title = "图标",sort = 0,type = ColumnFormatEnum.IMAGE)
    private Long imgId;
    //菜单名称
    @InitEditColumn(title = "菜单名称",sort = 1)
    private String name;
    //是否是可访问的节点
    @Basic
    @Column(name="pageNode")
    @InitEditColumn(title = "是否可访问",sort = 2,type = ColumnFormatEnum.DICT,dictCodeType = "Boolean")
    private boolean pageNode;
    //父组件
    @InitEditColumn(title = "父节点",sort = 3,required = false,type = ColumnFormatEnum.AUTO)
    private Long parentId;
    //对应的权限
    @InitEditColumn(title = "权限ID",sort = 4,required = false,type = ColumnFormatEnum.AUTO)
    private Long permissionId;
    //顺序
    @Column(name="menu_desc")
    @InitEditColumn(title = "排序",sort = 5)
    private int menuDesc;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Long getImgId() {
        return imgId;
    }

    public void setImgId(Long imgId) {
        this.imgId = imgId;
    }

    public Long getPermissionId() {
        return permissionId;
    }

    public void setPermissionId(Long permissionId) {
        this.permissionId = permissionId;
    }

    public boolean isPageNode() {
        return pageNode;
    }

    public void setPageNode(boolean pageNode) {
        this.pageNode = pageNode;
    }

    public int getMenuDesc() {
        return menuDesc;
    }

    public void setMenuDesc(int menuDesc) {
        this.menuDesc = menuDesc;
    }
}
